<?php
/**
 * Created by PhpStorm.
 * User: lscm
 * Date: 14-7-30
 * Time: 下午9:40
 */
require("common/dbutil.php");
//$dbServer = "localhost";
//$dbUser = "adsAdmin";
//$dbPassword = "";
//$dbName = "surfingHelper";
$con=\common\dbutil::getConnect();

$table="ads";
$cols="ad_category,ad_category_2, ad_type, ad_title, ad_price, ad_target_url, ad_material_urls, ad_from";
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
print_r($_POST);
$vals='"'.$_POST[ad_category].'"'.",".'"'.$_POST[ad_category_2].'"'.",".'"'.$_POST[ad_type].'"'.",".'"'.$_POST[ad_title].'"'.",".'"'.$_POST[ad_price].'"'.",".'"'.$_POST[ad_target_url].'"'.",".'"'.$_POST[ad_material_urls].'"'.",".'"'.$_POST[ad_from].'"';
//mysql_query("SET NAMES 'UTF8'");
//mysql_query("SET CHARACTER SET UTF8");
mysqli_set_charset($con,"utf8");
mysqli_query($con, 'INSERT INTO '.$table.' ('.$cols.') VALUES ('.$vals.')');

